# 辗转相除法求最大公约数
def gcd(m, n):
    while True:
        r = m % n
        m = n
        n = r
        if r == 0:
            return m


print(gcd(3333, 8888))
